// 通用的标题组件
<template>
  <div class="header">
    <back-ward></back-ward>
    <h1>{{ title }}</h1>
  </div>
</template>

<script>
import BackWard from "./Sub/BackWard.vue";

export default {
  name: "HomeHeader",
  //接收父组件传值
  props: {
    title: {
      type: String,
      //默认值为函数
      default: function () {
        return "一线生活通";
      },
    },
  },
  components: {
    BackWard: BackWard,
  },
};
</script>

<style lang="scss" scoped>
@import "~styles/mixins.scss";
@import "~styles/variables.scss";

.header {
  position: relative;
  @include flex-row;
  @include vh-center;
  height: $headerHeight;
  background-color: $defaultBgColor;

  h1 {
    font-size: 0.18rem;
  }
}
</style>